<?php

class Solution
{

    /**
     * @param Integer[] $nums
     * @param Integer $target
     * @return Integer[]
     */
    function twoSum($nums, $target)
    {
        $find = [];

        foreach ($nums as $index => $value) {
            $diff = $target - $value;
            if (isset($find[$diff])) {
                return [$find[$diff], $index];
            }

            $find[$value] = $index;
        }

        return [];
    }
}

$class = new Solution();
$result = $class->twoSum([3,3], 6);
var_dump($result);
